<template>
  <el-card>
    <!-- justify：设置水平对齐方式    align：设置垂直对齐方式 -->
    <el-row type="flex" justify="space-between" align="middle">
      <el-col>
        <!-- 通过变量 控制左边内容显示隐藏 -->
        <div v-if="showBefore" class="content">
          <i class="el-icon-info" />
          <span>
            <!-- 使用具名插槽 -->
            <slot name="before" />
          </span>
        </div>
      </el-col>
      <el-col>
        <el-row type="flex" justify="end">
          <!-- 使用具名插槽 -->
          <slot name="after" />
          <!-- <el-button>导入</el-button>
          <el-button>导出</el-button>
          <el-button>新增员工</el-button> -->
        </el-row>
      </el-col>
    </el-row>
  </el-card>
</template>

<script>
export default {
  props: {
    showBefore: {
      type: Boolean,
      default: true // 默认显示
    }
  }
}
</script>

<style lang="scss" scoped>
.content{
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #409eff;
    background-color: #e6f7ff;
    border-radius: 5px;
    i{
        color: #409eff;
        margin-right: 5px;
    }
}
</style>
